package com.weakteam.orderonline.administratorconsole.gwt.client.design;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.*;

/**
 *
 * @author Nail
 */
public class MainPage extends Composite {

    private static MainPageUiBinder uiBinder = GWT.create(MainPageUiBinder.class);

    interface MainPageUiBinder extends UiBinder<Widget, MainPage> {
    }
    private static MainPage instance = null;

    public static MainPage getInstance() {
        if (instance == null) {
            instance = new MainPage();
        }
        return instance;
    }

    @UiField
    protected TabPanel mainTabPanel;

    public MainPage() {
        initWidget(uiBinder.createAndBindUi(this));
        this.mainTabPanel.add(MenuEditPage.getInstance(), "Меню");
        this.mainTabPanel.getTabBar().setStyleName("mainTabBar");

        this.mainTabPanel.add(GoodsEditPage.getInstance(), "Товар");
        this.mainTabPanel.selectTab(0);
    }

}
